import java.util.Scanner;

public class zhengshu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a=in.nextInt();
        int[] b =new int[1000];
        int s=0;
        for (int i = 0; i <a; i++) {
            b[i]=in.nextInt();
        }
        int c =in.nextInt();
        for (int i = 0; i < b.length; i++) {
            if(b[i]==c){
                System.out.println(i+1);
                s=0;
                break;
            }
            else
                s++;
        }
        if(s>0)
            System.out.println("-1");
    }
}
